package cn.ym.mall.dao;

import cn.ym.mall.entity.RoleRights;

import java.sql.SQLException;
import java.util.List;

public interface RoleRightsDao {
    /**
     * 获得所有角色权限
     * @return
     * @throws SQLException
     */
    public List<RoleRights> getAll() throws SQLException;

    /**
     * 添加新角色权限
     * @param roleRights
     * @return
     * @throws SQLException
     */
    public int add(RoleRights roleRights) throws SQLException;

    /**
     * 根据角色Id删除角色权限
     * @param rid
     * @return
     * @throws SQLException
     */
    public int delete(Integer rid) throws SQLException;

    /**
     * 更新角色权限
     * @param roleRights
     * @return
     * @throws SQLException
     */
    public int update(RoleRights roleRights) throws SQLException;

    /**
     * 根据角色id获得角色权限
     * @return
     * @throws SQLException
     */
    public RoleRights getRoleRightsByRid(Integer rid) throws SQLException;

}
